/*************************************************************
 * File: PersistenceSupport.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Feb 21, 2013
 * Description: 
 ************************************************************/

package snow.core.persistence;

import java.io.Serializable;
import java.util.List;

import snow.core.domain.Pagination;
import snow.core.exceptions.BusinessException;

/**
 * 持久化工具接口
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
public interface PersistenceSupport {

	void delete(Object entity) throws BusinessException;

	<T> List<T> find(Class<T> entityClass, Conditions conditions, List<Order> orders, int start, int limit) throws BusinessException;

	<T> T find(Class<T> entityClass, Serializable id) throws BusinessException;

	Pagination findForPaging(Class<?> entityClass, Conditions conditions, List<Order> orders, int start, int limit) throws BusinessException;

	<ID extends Serializable> ID save(Object entity, Class<ID> idClass) throws BusinessException;

	void update(Object entity) throws BusinessException;

}
